import React from 'react';
import { Card, Col, Row } from 'antd';
import Quick from './components/quick';
import App from './components/app';
import { Notice } from './components/notice';
import { Banner } from './components/banner';
import { AxCard } from '@/components/AxBase';

const Index: React.FC<any> = () => {
  const HelperUrlPrefix = (window as any).ax.HelperUrlPrefix;
  let links: any = [
    // {
  //   iconFont: 'iconhuabanfuben',
  //   name: '打印测试',
  //   onClick: () => {
  //     window.open(location.origin + '/printtest.html', '_blank');
  //   },
  // }, {
  //   iconFont: 'iconplug-in',
  //   name: '打印插件',
  //   onClick: () => {
  //     window.open(location.origin + '/download/CLodop_Setup_for_Win32NT.exe', '_blank');
  //   },
  // },
   {
    icon: 'question-circle-o',
    name: '帮助中心',
    onClick: () => {
      window.open(HelperUrlPrefix, '_blank');
    },
  }, {
    iconFont: 'iconkefu',
    name: '客服中心',
    onClick: () => {
      window.open(HelperUrlPrefix + '?tid=0&id=9', '_blank');
    },
  }];

  return (
    <>
      <AxCard
        bodyStyle={{ backgroundColor: 'rgb(240,242,245)', margin: 0, padding: 0, height: 1000 }}
      >
        <Row gutter={16}>
          <Col xl={24} lg={24} md={24} sm={24} xs={24}>
            <AxCard
              title={<span style={{ color: '#fff' }}>后台管理系统购物商城&nbsp;&nbsp;站点服务中心</span>}
              style={{ margin: 0 }}
              headStyle={{
                fontSize: 24,
                fontWeight: "bold",
                fontFamily: 'cursive',
                border: '0',
                boxShadow: '0 2px 8px #f0f1f2',
                backgroundColor: '#409eff',
              }}
              bodyStyle={{ backgroundColor: 'rgb(240,242,245)', padding: 0 }}
            >
              <AxCard
                style={{ height: '100%', width: '72%', margin: '0px auto' }}
                bodyStyle={{ backgroundColor: 'rgb(240,242,245)', padding: 0 }}
              >
                <Banner />
                <Row gutter={16}>
                  <Col xl={16} lg={16} md={16} sm={16} xs={16}>
                    <App />
                  </Col>
                  <Col xl={8} lg={24} md={24} sm={24} xs={24}>
                    <Card
                      style={{ marginBottom: 16 }}
                      title="常用工具"
                      bordered={false}
                      bodyStyle={{ padding: 0 }}
                    >
                      <Quick onAdd={() => { }} links={links} />
                    </Card>
                    <Card
                      style={{ marginBottom: 16 }}
                      title="公告信息"
                      bordered={false}
                      bodyStyle={{ padding: 0 }}
                    >
                      <Notice />
                    </Card>
                  </Col>
                </Row>
              </AxCard>
              <AxCard
                style={{ height: '100%', width: '72%', margin: '0px auto', textAlign: 'center' }}
                bodyStyle={{ backgroundColor: 'rgb(240,242,245)' }}
              >
                <a href='https://beian.miit.gov.cn/' target='_blank' style={{ color: 'rgb(204, 204, 204)' }}>蜀ICP备20000933号-1</a>
              </AxCard>
            </AxCard>
          </Col>
        </Row>
      </AxCard>
    </>
  );
}

export default Index;
